package com.logic.landseaserver.ws.dto;

import java.util.Date;
import java.util.List;

import com.logic.common.exception.BusinessException;
import com.logic.landseaserver.domain.Customer;
import com.logic.landseaserver.domain.CustomerVersion;
import io.swagger.annotations.ApiModelProperty;

public class CustomerDTO {
    private Integer id;
    @ApiModelProperty(value = "姓名", position = 1)
    private String name;
    @ApiModelProperty(value = "电话", position = 1)
    private String phone;
    @ApiModelProperty(value = "是否从前端进入", position = 1)
    private Integer userId;
    @ApiModelProperty(value = "头像", position = 1,hidden = true)
    private String imgUrl;
    @ApiModelProperty(value = "openId", position = 1,hidden = true)
    private String openId;
    @ApiModelProperty(value = "性别", position = 1)
    private String gender;
    @ApiModelProperty(value = "生日", position = 1)
    private Date birthday;
    @ApiModelProperty(value = "职业", position = 1   )
    private String job;
    @ApiModelProperty(value = "爱好", position = 1   )
    private String hobby;
    @ApiModelProperty(value = "uniId", position = 1,hidden = true  )
    private String uniId;
    @ApiModelProperty(value = "昵称", position = 1)
    private String nickName;
    @ApiModelProperty(value = "身份证类型", position = 1)
    private String certificatesType;
    @ApiModelProperty(value = "身份证号", position = 1)
    private String certificatesNo;
    @ApiModelProperty(value = "身份证地址", position = 1)
    private String certificatesAddress;
    @ApiModelProperty(value = "身份证类型", position = 1,hidden = true  )
    private String certificatesTypeCH;
    @ApiModelProperty(value = "性别", position = 1)
    private String genderCH;
    @ApiModelProperty(value = "联系人关系", position = 1)
    private String emergRelation;
    private String emergRealtionCH;
    //邮箱
    @ApiModelProperty(value = "邮箱", position = 1)
    private String email;
    //紧急联系方式
    @ApiModelProperty(value = "紧急联系方式", position = 1)
    private String emergTel;
    //紧急账号
    @ApiModelProperty(value = "紧急联系人", position = 1)
    private String emergContact;

    //备注
    @ApiModelProperty(value = "备注", position = 1)
    private String memo;
    //抬头
    @ApiModelProperty(value = "发票_公司名称", position = 1)
    private String invoiceHead;

    //开户号
    @ApiModelProperty(value = "开户号", position = 1)
    private String openBank;

    //纳税人识别号
    @ApiModelProperty(value = "纳税人识别号", position = 1)
    private String identificationNumber;


    //银行账号
    @ApiModelProperty(value = "银行账号", position = 1)
    private String bankAccount;

    //公司电话
    @ApiModelProperty(value = "公司电话", position = 1)
    private String companyTel;

    //公司地址
    @ApiModelProperty(value = "公司地址", position = 1)
    private String invoiceAddress;

    private List<String> jobCH;

    private List<String> hobbyCH;

    private String versionNumber;

    private CustomerCardDTO customerCardDTO;

    public String getGenderCH() {
        return genderCH;
    }

    public void setGenderCH(String genderCH) {
        this.genderCH = genderCH;
    }

    public List<String> getJobCH() {
        return jobCH;
    }

    public void setJobCH(List<String> jobCH) {
        this.jobCH = jobCH;
    }

    public String getEmail() {
        return email;
    }

    public String getVersionNumber() {
        return versionNumber;
    }

    public void setVersionNumber(String versionNumber) {
        this.versionNumber = versionNumber;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getEmergTel() {
        return emergTel;
    }

    public void setEmergTel(String emergTel) {
        this.emergTel = emergTel;
    }

    public String getEmergRealtionCH() {
        return emergRealtionCH;
    }

    public void setEmergRealtionCH(String emergRealtionCH) {
        this.emergRealtionCH = emergRealtionCH;
    }

    public String getEmergContact() {
        return emergContact;
    }

    public void setEmergContact(String emergContact) {
        this.emergContact = emergContact;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public String getEmergRelation() {
        return emergRelation;
    }

    public void setEmergRelation(String emergRelation) {
        this.emergRelation = emergRelation;
    }

    public String getInvoiceHead() {
        return invoiceHead;
    }

    public void setInvoiceHead(String invoiceHead) {
        this.invoiceHead = invoiceHead;
    }

    public String getOpenBank() {
        return openBank;
    }

    public void setOpenBank(String openBank) {
        this.openBank = openBank;
    }

    public String getIdentificationNumber() {
        return identificationNumber;
    }

    public void setIdentificationNumber(String identificationNumber) {
        this.identificationNumber = identificationNumber;
    }

    public String getBankAccount() {
        return bankAccount;
    }

    public void setBankAccount(String bankAccount) {
        this.bankAccount = bankAccount;
    }

    public String getCompanyTel() {
        return companyTel;
    }

    public void setCompanyTel(String companyTel) {
        this.companyTel = companyTel;
    }

    public String getInvoiceAddress() {
        return invoiceAddress;
    }

    public void setInvoiceAddress(String invoiceAddress) {
        this.invoiceAddress = invoiceAddress;
    }

    public List<String> getHobbyCH() {
        return hobbyCH;
    }

    public void setHobbyCH(List<String> hobbyCH) {
        this.hobbyCH = hobbyCH;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUniId() {
        return uniId;
    }

    public void setUniId(String uniId) {
        this.uniId = uniId;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public String getHobby() {
        return hobby;
    }

    public void setHobby(String hobby) {
        this.hobby = hobby;
    }

    public String getCertificatesTypeCH() {
        return certificatesTypeCH;
    }

    public void setCertificatesTypeCH(String certificatesTypeCH) {
        this.certificatesTypeCH = certificatesTypeCH;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getCertificatesType() {
        return certificatesType;
    }

    public void setCertificatesType(String certificatesType) {
        this.certificatesType = certificatesType;
    }

    public String getCertificatesNo() {
        return certificatesNo;
    }

    public void setCertificatesNo(String certificatesNo) {
        this.certificatesNo = certificatesNo;
    }

    public String getCertificatesAddress() {
        return certificatesAddress;
    }

    public void setCertificatesAddress(String certificatesAddress) {
        this.certificatesAddress = certificatesAddress;
    }

    public CustomerCardDTO getCustomerCardDTO() {
        return customerCardDTO;
    }

    public void setCustomerCardDTO(CustomerCardDTO customerCardDTO) {
        this.customerCardDTO = customerCardDTO;
    }

    public static Customer fromDTOtoCustomer(CustomerDTO customerDTO) throws BusinessException {
        Customer customer = new Customer();
        customer.setId(customerDTO.getId());
        customer.setPhone(customerDTO.getPhone());
        customer.setName(customerDTO.getName());
        customer.setUserId(customerDTO.getUserId());
        customer.setCertificatesType(customerDTO.getCertificatesType());
        customer.setCertificatesNo(customerDTO.getCertificatesNo());
        customer.setCertificatesAddress(customerDTO.getCertificatesAddress());
        //Tony添加字段
        if (customerDTO.getBirthday() != null)
            customer.setBirthday(customerDTO.getBirthday());
        if (customerDTO.getGender() != null)
            customer.setGender(customerDTO.getGender());
        if (customerDTO.getHobby() != null)
            customer.setHobby(customerDTO.getHobby());
        if (customerDTO.getImgUrl() != null)
            customer.setImgUrl(customerDTO.getImgUrl());
        if (customerDTO.getJob() != null)
            customer.setJob(customerDTO.getJob());
        if (customerDTO.getOpenId() != null)
            customer.setOpenId(customerDTO.getOpenId());
        if (customerDTO.getNickName() != null)
            customer.setNickName(customerDTO.getNickName());
        if (customerDTO.getUniId() != null)
            customer.setUniId(customerDTO.getUniId());
        customer.setNickName(customerDTO.getNickName());
        customer.setEmail(customerDTO.getEmail());
        //紧急联系方式
        customer.setEmergTel(customerDTO.getEmergTel());
        //紧急账号
        customer.setEmergContact(customerDTO.getEmergContact());
        customer.setEmergRelation(customerDTO.getEmergRelation());
        //备注
        customer.setMemo(customerDTO.getMemo());
        //抬头
        customer.setInvoiceHead(customerDTO.getInvoiceHead());
        //开户号
        customer.setOpenBank(customerDTO.getOpenBank());
        //纳税人识别号
        customer.setIdentificationNumber(customerDTO.getIdentificationNumber());
        //银行账号
        customer.setBankAccount(customerDTO.getBankAccount());
        //公司电话
        customer.setCompanyTel(customerDTO.getCompanyTel());
        //公司地址
        customer.setInvoiceAddress(customerDTO.getInvoiceAddress());
        return customer;
    }


    public static CustomerVersion fromDTOtoCustomerVersion(CustomerDTO customerDTO) throws BusinessException {
        CustomerVersion customer = new CustomerVersion();
        customer.setPhone(customerDTO.getPhone());
        customer.setName(customerDTO.getName());
        customer.setUserId(customerDTO.getUserId());
        customer.setCertificatesType(customerDTO.getCertificatesType());
        customer.setCertificatesNo(customerDTO.getCertificatesNo());
        customer.setCertificatesAddress(customerDTO.getCertificatesAddress());
        //Tony添加字段
        if (customerDTO.getBirthday() != null)
            customer.setBirthday(customerDTO.getBirthday());
        if (customerDTO.getGender() != null)
            customer.setGender(customerDTO.getGender());
        if (customerDTO.getHobby() != null)
            customer.setHobby(customerDTO.getHobby());
        if (customerDTO.getImgUrl() != null)
            customer.setImgurl(customerDTO.getImgUrl());
        if (customerDTO.getJob() != null)
            customer.setJob(customerDTO.getJob());
        if (customerDTO.getOpenId() != null)
            customer.setOpenid(customerDTO.getOpenId());
        if (customerDTO.getNickName() != null)
            customer.setNickName(customerDTO.getNickName());
        if (customerDTO.getUniId() != null)
            customer.setUniid(customerDTO.getUniId());
        customer.setEmail(customerDTO.getEmail());

        //紧急联系方式
        customer.setEmergTel(customerDTO.getEmergTel());
        //紧急账号
        customer.setEmergContact(customerDTO.getEmergContact());

        //备注
        customer.setMemo(customerDTO.getMemo());
        //抬头
        customer.setInvoiceHead(customerDTO.getInvoiceHead());
        //开户号
        customer.setOpenBank(customerDTO.getOpenBank());
        //纳税人识别号
        customer.setIdentificationNumber(customerDTO.getIdentificationNumber());
        //银行账号
        customer.setBankAccount(customerDTO.getBankAccount());
        //公司电话
        customer.setCompanyTel(customerDTO.getCompanyTel());
        //公司地址
        customer.setInvoiceAddress(customerDTO.getInvoiceAddress());
        return customer;
    }
}
